#include "qbcishape.h"

QBciShape::QBciShape()
{

}

void QBciShape::stylePaint(QPainter *painter){
    if (Status) {
      painter->drawImage(QRect(X, Y, Width, Height), SetImage);
    } else {
      painter->drawImage(QRect(X, Y, Width, Height), UnsetImage);
    }
}

void QBciShape::getStatus(const bool &status){
    Status = status;
}

void QBciShape::getGeometry(const int &x, const int &y, const int &width, const int &height){
    X = x;
    Y = y;
    Width = width;
    Height = height;
}

void QBciShape::setSetImage(const QString &mapPath) {
    SetImage = QImage(mapPath);
}

void QBciShape::setSetImage(const QImage &src) {
    SetImage = src;
}
void QBciShape::setUnsetImage(const QString &mapPath) {
    UnsetImage = QImage(mapPath);
}
void QBciShape::setUnsetPixmap(const QImage &src) {
    UnsetImage = src;
}

void QBciShape::rotate(const qreal &degree) {
  QTransform transform;
  transform.rotate(degree);
  SetImage = SetImage.transformed(transform);
  UnsetImage = UnsetImage.transformed(transform);
}

void QBciShape::getIcon(const QString &setImagePath,const QString &unsetImagePath){
    setSetImage(setImagePath);
    setUnsetImage(unsetImagePath);
}
